package database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import entity.User;

/**
 * @program: Custom-Navigation-Drawer-master
 * @description:
 * @author:
 * @create: 2020-12-07 14:20
 **/
public class DBServer {
    private DBHelper dbhelper;
    public DBServer(Context context)
    {
        this.dbhelper = new DBHelper(context);
    }
    public void addUser(User entity)
    {

        SQLiteDatabase localSQLiteDatabase = this.dbhelper.getWritableDatabase();
        Object[] arrayOfObject = new Object[6];
        arrayOfObject[0] = entity.getIdUE_ID();
        arrayOfObject[1] = entity.getScene();
        arrayOfObject[2] = entity.getLoading();
        arrayOfObject[3] = entity.getBuffering();
        arrayOfObject[4] = entity.getQuality();
        arrayOfObject[5] = entity.getOverall_quality();
        localSQLiteDatabase.execSQL("insert into user(idUE_ID,scene,quality,loading,buffering ,overall_quality) values(?,?,?,?,?,?)", arrayOfObject);
        localSQLiteDatabase.close();
    }
}
